package com._101aiot.test.springdatajpa.controller;

import com._101aiot.common.resultutil.CommonResult;
import com._101aiot.test.springdatajpa.entity.User;
import com._101aiot.test.springdatajpa.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/test-user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/list")
    public CommonResult<List<User>> list(){

        return CommonResult.success(userService.list());
    }

}
